package com.anandsoftware.test;

import java.util.HashSet;
import java.util.Set;

import com.anandsoftware.security.SecurityAlgorithm;
import com.anandsoftware.security.SecurityUtil;
import com.anandsoftware.service.RegistrationService;
import com.anandsoftware.service.impl.RegistrationServiceImpl;
import com.anandsoftware.system.domain.SystemInformation;

public class RegistrationServiceImplTestwithenc {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		RegistrationService register = new RegistrationServiceImpl();

		/*
		 * String key=register.requestServiceAccess("11111111"); Set<String>
		 * macIdList=new HashSet<String>(); macIdList.add("00:3e:54:98:87");
		 * macIdList.add("00:3e:54:98:88"); macIdList.add("00:3e:54:98:89");
		 * 
		 * SystemInformation sysInfo = new SystemInformation();
		 * sysInfo.setOsDriveSerialNumber("DECF-02A3"); sysInfo.setOsName("XP");
		 * sysInfo.setOsOriginalInstallDate("31-12-2010");
		 * sysInfo.setOsProductKey("XERS-OIHG-HGDDVF-HHFFT-UYUY");
		 * sysInfo.setOsVersion("3.2"); sysInfo.setPhysicalMemory("2048 MB");
		 * sysInfo.setSystemType("x86 CPU"); sysInfo.setMacIdList(macIdList);
		 * 
		 * register.registerSystemInformation(sysInfo,key, "11111111");
		 */

		String key = register.requestServiceAccess("11111111");
		Set<String> macIdList = new HashSet<String>();
		macIdList.add("00:3e:54:98:87");
		macIdList.add("00:3e:54:98:88");
		macIdList.add("00:3e:54:98:89");

		SystemInformation sysInfo = new SystemInformation();
		sysInfo.setOsDriveSerialNumber("DECF-02A3");
		sysInfo.setOsName("XP");
		sysInfo.setOsOriginalInstallDate("31-12-2010");
		sysInfo.setOsProductKey("XERS-OIHG-HGDDVF-HHFFT-UYUY");
		sysInfo.setOsVersion("3.2");
		sysInfo.setPhysicalMemory("2048 MB");
		sysInfo.setSystemType("x86 CPU");
		sysInfo.setMacIdList(macIdList);

		SystemInformation sysInfoSHA1 = SecurityUtil.encryptValue(sysInfo,
				SecurityAlgorithm.SHA1);
		register.registerSystemInformation(sysInfo, key, "11111111");
		register.registerSystemInformation(sysInfoSHA1, key, "11111111");
		register.terminateService("11111111");
	}

}
